<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<script type="text/javascript" src="js/jquery-1.8.2.js"></script>
<script type="text/javascript">
$(document).ready(function() { 
	$('#btn').bind('click',function(){//为什么点击事件必须在上面方法里面
		//alert("User clicked on btn");
		alert($(this).val());
		console.log("User clicked on btn");
		console.log($("[name=ckbName]:checkbox").prop("checked",this.checked));

	});
	
	$('#ckb').bind('click',function(){
		console.log('%o',$("[name=ckbName]:checkbox").prop("checked",this.checked));
		console.log(this.checked);
	});
});
	
</script>
<body>
	<input id="btn" type="button" value="点击"/>	
	<input type="checkbox" value="复选框" id="ckb" name="ckbName"/>
</body>
</html>